package edu.ntu.cloudroid.model.function.stats;

import java.util.List;

import edu.ntu.cloudroid.model.data.AbstractData;

public class AverageFunction implements IDataStats{

	@Override
	public Object getStats(List<AbstractData> data, Object params) throws Exception{
		
		AbstractData avgInstance = data.get(0);
		int colIdx = ((Integer)params).intValue();
		System.out.println("IS AVERAGE FUNCTION *********, name = "+avgInstance.getName());
		return avgInstance.getWindowAverage(data, colIdx);
	}

}
